package com.example.shop.fgo.utils;

import com.example.shop.fgo.R;

/**
 * Created by Administrator on 2017/2/11.
 */

public class IconUtil {
    public static int getDrawable(String icon){
        //写反了会导致空指针
        if ("avi".equalsIgnoreCase(icon)) {
            return R.drawable.ft_avi;
        }
        if ("txt".equalsIgnoreCase(icon)) {
            return R.drawable.ft_txt;
        }
        if ("html".equalsIgnoreCase(icon)) {
            return R.drawable.ft_html;
        }
        if ("mp4".equalsIgnoreCase(icon)) {
            return R.drawable.ft_mp4;
        }
        if ("rar".equalsIgnoreCase(icon)) {
            return R.drawable.ft_rar;
        }
        if ("zip".equalsIgnoreCase(icon)) {
            return R.drawable.ft_zip;
        }
        if ("java".equalsIgnoreCase(icon)) {
            return R.drawable.ft_java;
        }
        if ("mp3".equalsIgnoreCase(icon)) {
            return R.drawable.ft_mp3;
        }
        if ("png".equalsIgnoreCase(icon)) {
            return R.drawable.ft_png;
        }
        if ("jpg".equalsIgnoreCase(icon)) {
            return R.drawable.ft_jpg;
        }
        if ("gif".equalsIgnoreCase(icon)) {
            return R.drawable.ft_gif;
        }
        return R.drawable.ic_type_unknow;
    }
}
